<template>
  <div>
    <!-- 1.0 查询表单 -->
    <el-form :inline="true" :model="searchData" class="demo-form-inline">
      <el-form-item label="审批人">
        <el-date-picker
          v-model="searchData.date"
          type="datetimerange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          align="right"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">查询</el-button>
      </el-form-item>
    </el-form>

    <!-- 2.0 图表 -->
    <div class="show-charts">
      <div ref="goods" style="width: 700px;height:400px;"></div>
    </div>
  </div>
</template>

<script>
import * as echarts from 'echarts'
import { option } from './options.js'

export default {
  data() {
    return {
      searchData: {
        date: []
      }
    }
  },
  mounted() {
    this.chartsInit()
  },
  methods: {
    onSubmit() {
      console.log('submit!')
    },
    chartsInit() {
      var myChart = echarts.init(this.$refs.goods)
      myChart.setOption(option)
    }
  }
}
</script>

<style lang="less" scoped>
.show-charts {
  background-color: #fff;
  padding: 40px;
}
</style>
